//index.js
//获取应用实例
var app = getApp()
Page({
  data:{
    msg:""
  },
  reg: function () {
    wx.navigateTo({
      url: '../reg/reg'
    })
  },
  login: function (e) {
    var that = this;
    
    wx.request({
      url: 'https://www.sswan666.top',
      data: e.detail.value,
      method: 'POST', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNEC
      header: { 'content-type': 'application/json' },

      success: function (res) {
        
        if (res.data.status == 1){
          wx.reLaunch({
            url: '../user/user?user_id='+res.data.user_id,
          })
        }else{
          that.setData({ msg: res.data.msg });
        }
      },
      fail:function(){
        that.setData({msg:"网络错误"});
      }
    });

  },

  forget: function () {
    wx.navigateTo({
      url: '../forget/forget'
    })
  },
})
